package com.zt.student.controller;

import com.zt.common.pojo.common.JsonResult;
import com.zt.common.pojo.homework.HomeworkAnswer;
import com.zt.student.service.HomeworkAnswerService;
import com.zt.student.service.HomeworkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * description:
 * author:zt
 * date:2022-02-13
 */
@RestController
@CrossOrigin
@RequestMapping("homeworkAnswer")
@Api("作业作答模块")
public class HomeworkAnswerController {

    @Autowired
    private HomeworkAnswerService homeworkAnswerService;

    @PostMapping("add")
    @ApiOperation("新增作业回答")
    public JsonResult addAnswer(@RequestBody HomeworkAnswer homeworkAnswer, HttpServletRequest request){

        homeworkAnswerService.insert(homeworkAnswer,request);
        return JsonResult.success();
    }
}
